"use strict";
/*正则表达式*/
//构造函数
var reg = new RegExp("mayouchen");
var reg1 = new RegExp("mayouchen", 'gi');
console.log('reg', reg);
console.log('reg1', reg1);
//字面量声明
var reg2 = /mayouchen/;
var reg3 = /mayouchen/gi;
//常用方法   test()  exec()
var reg4 = /mayouchen/gi;
var reg5 = /boy/i;
var name1 = 'mayouchen is a good boy!';
var result1 = reg4.test(name1);
console.log(result1, "find the mayouchen");
console.log(reg5.exec(name1), "执行喔");
